<?php 

session_start();
//include("Connections/localhost.php");
include("database/database.php");
include("includes/function.php");

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Home</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="style.css" />
</head>

<body>
	<div id="header">
		<div class="block1">
			<ul>
            	<li>
                
        <?php if(session_is_registered("email")){?>Xin chào  
		<?php $user=$_SESSION["email"];
			echo "<b><font color='#FF6600'>".ucfirst($user)."</font></b>";?><br>
          <a href="index.php?page=profile">Hồ sơ cá nhân </a><br>
          <a href="index.php?page=login&&action=logout">Thoát</a>
          
		  <?php }else{?>
          		
			   <form action="index.php?page=login&&action=login" method="post" name="Login">
                <table>
                <tr><td>Email:</td><td><input name="txtuser" type="text" size="15" value="<?php echo $_POST['txtuser'];?>"></td><td><input name="remember" type="checkbox"  <?php if($_POST['remember']!=""){?> checked <?php }?> ></td></tr>
                <tr><td>Password:</td><td><input name="txtpass" type="password" size="15" value="<?php echo $_POST['txtpass']?>"></td><td><input name="submit" type="submit" value="Login" class="button"/></td></tr>
                </table>
                </form>
			
		<?php }?>
               
                
                </li>
                
                
				<!--<li>
					<img src="images/square.jpg" alt="" width="11" height="11" class="squ" />
					Choose Language : 
					<a href="#"><img src="images/flag1.jpg" alt="" width="20" height="14" /></a>
					<a href="#"><img src="images/flag2.jpg" alt="" width="20" height="14" /></a>
					<a href="#"><img src="images/flag3.jpg" alt="" width="20" height="14" /></a>
				</li>
				<li>
					<img src="images/square.jpg" alt="" width="11" height="11" class="squ" />
					Currencies :
					<select class="select">
						<option value="">US Dollar</option>
						<option value="">US Dollar</option>
					</select>
				</li>-->
			</ul>
		</div>
		<div class="block2">
			<ul>
				<li><a href="index.php?page=login">Đăng nhập</a></li>
				<li><a href="index.php?page=detailcart">Chi tiết giỏ hàng</a></li>
				<li><a href="index.php?page=signup">Tạo tài khoản</a></li>
				<li><a href="index.php?page=search">Tìm kiếm sản phẩm</a></li>
				<li><a href="index.php?page=contact">Liên lạc</a></li>
			</ul>
		</div>
		<div class="block3">
			<a href="index.php?page=detailcart"><img src="images/cart.jpg" alt="" width="35" height="25" /></a>
			<span>Shopping<br /> Cart</span>
			<span>Giỏ hàng có:<strong>
           	<?php if(session_is_registered("idkh")){
						$kh=$_SESSION["idkh"]; 
						$tong=mysql_query("select * from cart where idkh='$kh'");
						$result=mysql_num_rows($tong);
			?> 
			 
					<a href="index.php?page=detailcart"><?php  echo $result; ?> </a> 
			<?php }else{ ?>
				    <?php echo "0";?>
			<?php }?>
             sản phẩm
            </strong></span>
		</div>
		<a href="#"><img src="images/name.jpg" alt="" width="396" height="117" /></a><img src="images/pic1.jpg" alt="" width="370" height="117" /><br />
		<ul class="menu">
			<li><a href="index.php?pageNow=1"><img src="images/but1.jpg" alt="" width="135" height="36" /></a></li>
			<li><a href="index.php?page=product&&pageNow=1"><img src="images/but2.jpg" alt="" width="130" height="36" /></a></li>
			<li><a href="index.php?page=introduce"><img src="images/but3.jpg" alt="" width="130" height="36" /></a></li>
			<li><a href="index.php?page=promotion"><img src="images/but4.jpg" alt="" width="130" height="36" /></a></li>
			<li><a href="index.php?page=service"><img src="images/but5.jpg" alt="" width="130" height="36" /></a></li>
			<li><a href="index.php?page=contact"><img src="images/butclean.jpg" alt="" width="111" height="36" /></a></li>
		</ul>
	</div>
	<div id="content">
		<div class="left">
			<img src="images/title1.jpg" alt="" width="198" height="30" /><br />
			<ul>
            	<!-- DANH MUC SAN PHAM-->
				<!--<li class="dots"><a href="#">Desktops</a></li>-->
                
            <?php 
			$sql =mysql_query("select * from category");
			while($row=mysql_fetch_row($sql)){
			    echo "<li class='dots'><a href='index.php?page=search&&act=mahsx&&pageNow=1&&id=$row[0]'>".strtoupper($row[1])."</a></li>";	     
			}
			?>
            
			</ul>
			<img src="images/title2.jpg" alt="" width="198" height="30" /><br />
			<ul>
            	<!-- PHU KIEN -->
				<!-- <li class="dots"><a href="#">News</a></li> -->
                <?php 
				$sql=mysql_query("select * from catergoryadditional");
				while($row=mysql_fetch_row($sql)){
					echo "<li class='dots'><a href='index.php?page=additionaldetail&&id=$row[0]'>".strtoupper($row[2])."</a></li>";
				}
				?>
                
			</ul>
		</div>
		<div class="right">
        	<?php include("control/main.php");?>
        	<!-- SAN PHAM -->
			<!-- <div class="item">
				<img src="images/bordtop.gif" alt="" width="274" height="2" />
				<div>
					<img src="images/item1.jpg" alt="" width="102" height="88" class="items" />
					<h1>TÊN SẢN PHẨM</h1>
					<span><b>Tình trạng:  </b>tình trạng </span>
					<p><strong>$ GIÁ</strong></p>
					<a href="index.php?page=detail"><img src="images/button1.gif" alt="" width="129" height="20" /></a>
					<a href="index.php?page=cart"><img src="images/button2.gif" alt="" width="127" height="20" /></a>
				</div>
				<img src="images/bordbot.gif" alt="" width="274" height="2" />
			 </div>
             -->
		</div>
	</div>
	<div id="footer">
		Copyright &copy; 2010  / Thiết kế  bởi Sinh Viên Đại Học Nông Lâm TPHCM - Niên khóa: 2006 - 2010 <br />
	</div>
</body>
</html>
